#ifndef CHESSBOTBOARD_BSP_SDCARD_H
#define CHESSBOTBOARD_BSP_SDCARD_H

#include "config.h"
#include <Arduino.h>
#ifdef FILE_READ
#undef FILE_READ
#endif

#ifdef FILE_WRITE
#undef FILE_WRITE
#endif

//#include <SD.h>
#include <SPI.h>
#include <SdFat.h>
#include <sdios.h>


extern SdFile file;
extern SdFile dir;
extern SdFat sd;

extern char pwd_path[];
extern const uint16_t NAME_LENGTH;
extern const uint16_t LINE_LENGTH;
extern uint16_t saved_dirIndex[20];



bool hasSuffix(const char* str, const char* suffix);
long countLines(SdFile* file);
void sdInit();
void sdRead();
void executeFile(int cur_file_idx);
#endif //CHESSBOTBOARD_BSP_SDCARD_H
